package com.kun.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.kun.annotations.IgnoreTenantTable;
import com.kun.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 菜单表
 *
 * @author kun.li
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName
@IgnoreTenantTable
public class SysMenu extends BaseEntity {

    @TableId
    @Schema(description = "菜单ID")
    private String menuId;

    @Schema(description = "菜单名称")
    private String menuName;

    @Schema(description = "父级ID")
    private String parentId;

    @Schema(description = "url权限")
    private String urlPermission;

    @Schema(description = "按钮权限")
    private String btnPermission;
    /**
     * 1 菜单 2 操作资源
     */
    @Schema(description = " 1 菜单 2 操作资源")
    private Integer menuType;


    @Schema(description = "请求方法类型 GET POST　PUT DELETE")
    private String methodType;

    /**
     * 路由路径
     */
    @Schema(description = "路由路径")
    private String Path;
    /**
     * 组件
     */
    @Schema(description = "组件")
    private String component;
    /**
     * 路由名称
     */
    @Schema(description = "路由名称")
    private String name;
    /**
     * 路由重定向地址
     */
    @Schema(description = "路由重定向地址")
    private String redirect;
    /**
     * 排序字段
     */
    @Schema(description = "排序字段")
    private Long weight;
    /**
     * 图标
     */
    @Schema(description = "图标")
    private String icon;

    /**
     * 是否需要认证 0 为true 1 为false
     */
    @Schema(description = "是否需要认证 0 为true 1 为false")
    private Integer requiresAuth;
    /**
     * 是否作为首页
     * 0 为true 1为false
     */
    @Schema(description = "是否作为首页 0 为true 1为false")
    private Integer hasHome;



    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<SysMenu> children;

}
